package xyz.codej.websocket.netty.server.service;

import xyz.codej.websocket.netty.server.dto.Response;
import xyz.codej.websocket.netty.server.entity.Client;

/**
 * @ClassName: MessageService
 * @Description TODO
 * @Author 王华君
 * @Date 2020/4/1 3:32 下午
 * @VERSION 1.0
 */
public class MessageService {
    public static Response sendMessage(Client client, String message) {
        Response res = new Response();
        res.getData().put("id", client.getId());
        res.getData().put("message", message);
        // 返回毫秒数
        res.getData().put("ts", System.currentTimeMillis());
        return res;
    }
}
